<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<div id="app">
    <h1>{{msg}}</h1>
    <input type="text" v-model.trim.number.lazy="msg">
</div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    //指令修饰符
    //trim 用于修饰数据两段的空格
    //lazy 将实施变更数据变成失去焦点之后改变数据
    //number 将输入的数据转换成Number类型
    let vm = new Vue({
        el: "#app",
        data: {
            msg: "那是我日夜思念深深爱着的人啊"
        }
    })
</script>
